package cn.qlu.yhy.dao.mybatisImp;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cn.qlu.yhy.dao.IUserDao;
import cn.qlu.yhy.model.User;
import cn.qlu.yhy.model.enumpack.Role;

@Component
public class UserDaoImpl implements IUserDao {

    @Autowired
    private SqlSessionTemplate sst;

    private static final String CLASS_NAME = User.class.getName();

    //    public User getUserByName(String userName) {
    //        return sst.selectOne(CLASS_NAME + ".getUserByName", userName);
    //    }

    @Override
    public User getUserByUserId(int userId) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public User getUserByUserNamePassword(String username, String password) {
        // TODO Auto-generated method stub

        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("username", username);
        paramMap.put("password", password);
        return sst.selectOne(CLASS_NAME + ".getUserByUserNamePassword", paramMap);
    }

    @Override
    public User getUserByName(String userName) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public User getUserByNickname(String nickname) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public boolean getUserExistByUserName(String userName) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public boolean getUserExistByNickname(String nickname) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public List<User> findUsers() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<User> findUsersByRole(Role role) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public boolean createUser(User user) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public boolean deleteUser(int userId) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public boolean updateUser(User user) {
        // TODO Auto-generated method stub
        return false;
    }

}
